package com.taldh;

import org.junit.Assert;
import org.junit.Test;

import java.util.Arrays;
import java.util.stream.Collectors;

public class IsPalindrome {

    @Test
    public void isPalindromeTest() {
        Assert.assertTrue(isPalindrome(""));
        Assert.assertFalse(isPalindrome("race a car"));
        Assert.assertTrue(isPalindrome("A man, a plan, a canal: Panama"));
        Assert.assertTrue(isPalindrome("."));
        Assert.assertTrue(isPalindrome("a."));
    }

    public boolean isPalindrome(String s) {
        if (s == null || s.trim().length() == 0) {
            return true;
        }

        s.chars().filter(c -> (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9')).boxed().collect(Collectors.toList());

        return false;

    }


}
